#include "resshowwid.h"
#include <QTableWidgetItem>
#include <QHeaderView>
#include <QStringList>
ResShowWid::ResShowWid(QWidget *parent) : QWidget(parent)
{
    resize(400,800);
    this->table = new QTableWidget(this);
    this->table->resize(400,800);
    this->table->setRowCount(50);
    this->table->setColumnCount(1);
    this->table->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);//居中
    this->table->verticalHeader()->setVisible(false);
    this->table->setEditTriggers(QAbstractItemView::NoEditTriggers);
    this->sum = 0;
    //this->table->setStyleSheet("background-image: url(:/new/prefix1/Images/tablebg.jpg);");
}

void ResShowWid::Add(int row,QTableWidgetItem *item)
{
    this->table->setItem(row,0,item);
}

void ResShowWid::tableClear()
{
    this->table->clear();
    QStringList header;
    header<<"路线规划结果";
    this->table->setHorizontalHeaderLabels(header);
}
